/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package lu.med.praxiswahl.wahlumed.model.beans;

import java.io.Serializable;
import java.util.Calendar;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;

/**
 * 
 * @author pkendzo
 */
@Entity
@Table(name = "PRAXIS_HAUSAERZTE")
public class DoctorsTBL implements Serializable {

	private static final long serialVersionUID = 1L;

	public DoctorsTBL() {

	}

	@Column(name = "doctor_ID")
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;

	private String nachname;
	private String vorname;
	private String adresse;
	private String email;
	private String telefon;
	private String fax;
	private String fachgebiet;
	private String website;
	private String ucmCode;
	
	@OneToOne
	@JoinColumn(name = "LAST_EDITOR", nullable = true)
	private AccountingTBL lastEditor;

	@Column(name = "LAST_EDITED")
	@Temporal(javax.persistence.TemporalType.TIMESTAMP)
	private Calendar lastEditTime;
	

	@OneToMany(mappedBy = "haus_artzID", cascade = { CascadeType.MERGE,
			CascadeType.PERSIST, CascadeType.REFRESH /*
													 * , CascadeType .REMOVE
													 */}, fetch = FetchType.LAZY)
	private Set<CustomerTBL> customers = new HashSet<CustomerTBL>();

	public Set<CustomerTBL> getCustomers() {
		return customers;
	}

	public void setCustomers(Set<CustomerTBL> customers) {
		this.customers = customers;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Override
	public int hashCode() {
		int hash = 0;
		hash += (id != null ? id.hashCode() : 0);
		return hash;
	}

	@Override
	public boolean equals(Object object) {
		// TODO: Warning - this method won't work in the case the id fields are
		// not set
		if (!(object instanceof DoctorsTBL)) {
			return false;
		}
		DoctorsTBL other = (DoctorsTBL) object;
		if ((this.id == null && other.id != null)
				|| (this.id != null && !this.id.equals(other.id))) {
			return false;
		}
		return true;
	}

	@Override
	public String toString() {
		return "lu.med.praxiswahl.wahlumed.model.beans.DoctorsTBL[id=" + id
				+ "]";
	}

	public String getAdresse() {
		return adresse;
	}

	public void setAdresse(String adresse) {
		this.adresse = adresse;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	public String getNachname() {
		return nachname;
	}

	public void setNachname(String nachname) {
		this.nachname = nachname;
	}

	public String getTelefon() {
		return telefon;
	}

	public void setTelefon(String telefon) {
		this.telefon = telefon;
	}

	public String getVorname() {
		return vorname;
	}

	public void setVorname(String vorname) {
		this.vorname = vorname;
	}

	public String getFachgebiet() {
		return fachgebiet;
	}

	public void setFachgebiet(String fachgebiet) {
		this.fachgebiet = fachgebiet;
	}

	public String getWebsite() {
		return website;
	}

	public void setWebsite(String website) {
		this.website = website;
	}

	public String getUcmCode() {
		return ucmCode;
	}

	public void setUcmCode(String ucmCode) {
		this.ucmCode = ucmCode;
	}

	public AccountingTBL getLastEditor() {
		return lastEditor;
	}

	public void setLastEditor(AccountingTBL lastEditor) {
		this.lastEditor = lastEditor;
	}

	public Calendar getLastEditTime() {
		return lastEditTime;
	}

	public void setLastEditTime(Calendar lastEditTime) {
		this.lastEditTime = lastEditTime;
	}

	
}
